import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
	state: {
		count: 2
	},
	mutations: {
		add (state, n) {
			state.count += n
		},
		reduce (state) {
			state.count--
		}
	},
	getters: {
		count: state => state.count += 10
	},
	actions: {
		add2 ({ commit }) {
			setTimeout(() => {
				commit('add', 3)
			}, 3000)
		},
		reduce2 ({ commit }) {
			commit('reduce')
		}

	},
	modules: {

		a:{



		}
	}
})
